﻿using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using ExcellentCRM.DataService.Models;

namespace ExcellentCRM.Site.Models
{
    public class StuClientModel : StuClient
    {
        public new StudentInfoModel StudentInfo { get; set; }
    }

    public class StudentInfoModel : StudentInfo
    {
        [Remote("VerifyStuExists", "StuClient", AdditionalFields = "Id,Phone,CellPhone,Email", ErrorMessage = "该学员信息已存在", HttpMethod = "post")]
        [StringLength(30)]
        [Display(Name = "姓名")]
        [Required(AllowEmptyStrings = false)]
        public new string StuName { get; set; }


        [Remote("VerifyStuExists", "StuClient", AdditionalFields = "Id,StuName,CellPhone,Email", ErrorMessage = "该学员信息已存在", HttpMethod = "post")]
        [StringLength(20)]
        [Display(Name = "电话")]
        public new string Phone { get; set; }

        [Remote("VerifyStuExists", "StuClient", AdditionalFields = "Id,Phone,StuName,Email", ErrorMessage = "该学员信息已存在", HttpMethod = "post")]
        [StringLength(20)]
        [Display(Name = "手机")]
        public new string CellPhone { get; set; }

        [Remote("VerifyStuExists", "StuClient", AdditionalFields = "Id,Phone,CellPhone,StuName", ErrorMessage = "该学员信息已存在", HttpMethod = "post")]
        [EmailAddress]
        [DataType(DataType.EmailAddress)]
        [StringLength(100)]
        [Display(Name = "邮箱")]
        public new string Email { get; set; }
    }
}